module.exports = {
  nav_name: '标签管理', //生成导航菜单
  module_name: 'label_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/label/page", // 分页
    detail: commonPath + '/admin/label/get', //详情,
    add: commonPath + '/admin/label/save', //添加
    edit: commonPath + "/admin/label/edit", //编辑
    del: commonPath + "/admin/label/remove", //删除
  }`,
  table: {
    nav_name: "标签列表",
    tipsText: "标签管理 >> 标签列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { 
        title: '等级', 
        name: 'temp', //内嵌时不填或temp
        name: '', 
        type: "innerCode",
        innerCode: `{{scope.row.parentId ? "二级" : "一级"}}`,
      },  //加条件判断的原生雷
      { title: '标签名称', name: 'name', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/label_manager_add_page"
      },
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.label_manager.del",
        requestType: 'get',
      },
    ],
    search: {
      contentArr: {
        input1: { labelName: '标签名称', inputName: 'name' },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "添加",
        request: false,
        jump: "/label_manager_add_page"
      }
    },
  },

  
  //添加页面
  add_page: {
    isGenerate: "false",  //当isGenerate == 'false'时，不生成该页面
    tipsText: "标签管理 >> 标签",
    formData: {
      titleText: "提示：二级标签需选择父级标签，一级标签直接添加",
      input1: {
        labelName: '标签名称',
        inputName: 'name',
        isNeed: 'true',
      },
      select1: {
        labelName: '选择父级标签',
        inputName: 'parentId',  //输入绑定的变量
        selectOptsName: "labelOpts",
        selectOptsArr: `[
            { value: "", label: "请选择"},
          ],
          `, //选项数组
        // isNeed: 'true',
      },
    },
    addBtn: {
      text: '添加',
      url: "API.label_manager.add"
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.label_manager.detail",
      detailType: 'get',
      detailParams: {},  //这里是对象,非字符串, 只能写给定值的参数
      isSplitSearchString: 'true', //列表拼接查询字符串
      editUrl: "API.label_manager.edit",
      jump: '/label_manager_table',
    },
    cancelBtn: { text: "取消" }, //

     //额外请求
     extraRequest: {
      dataCode: [
        "labelOpts"
      ],
      methodsCode: [
        {
          explainText: "标签数据获取", //说明
          type: "opts",  //表示选项类型格式，value, label
          methodName: "getAllLabel",
          api: "API.label_manager.page",
          optsName: "labelOpts",
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,
          optsConfig: {
            label: "name",
            value: "id"
          },
          //后续添加，选项初始值可在输入配置里设置
        }
      ]
    },
    
  },

  // //详情页面
  // detail_page: {
    
  // }
}
